package edu.jsnu.operate.controller.ticket.common;

import dto.resDto.JsonData;
import edu.jsnu.service.ticket.system.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("ticket/upload")
public class UploadController {

    @Autowired
    private ImageService imageService;

    @RequestMapping(value = "/image.json")
    @ResponseBody
    public JsonData upload(MultipartFile file) {
        return  imageService.upload(file);
    }
}
